package com.tensquare.recruit.service;

import com.tensquare.recruit.dao.RecruitDao;
import com.tensquare.recruit.pojo.Recruit;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author Macross
 * @Type RecruitService.java
 * @Desc
 * @date 2019/12/17 15:52
 */
@Service
public class RecruitService {

    @Autowired
    private RecruitDao recruitDao;

    /**
     * 查询职位推荐信息列表
     * @return
     */
    public List<Recruit> recommend() {
        //查询并返回职位推荐列表
        return recruitDao.findTop4ByStateOrderByCreateTimeDesc("2");
    }

    /**
     * 查询最新职位信息列表
     * @return
     */
    public List<Recruit> getNewList() {
        return recruitDao.findTop12ByStateNotOrderByCreateTimeDesc("0");

    }
}
